#pragma GCC optimize(2)
#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
#include <stack>
#include <bitset>
#define F first
#define S second
#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;

void solve()
{
	ll n;
	cin>>n;
	ll l=0;
	ll r=2e9;
	while(l<r)
	{
		ll mid=l+r>>1;
		if( mid * (mid - 1) / 2ll >= n) r=mid;
		else l=mid+1;
	}
	if(l*(l-1)/2ll==n) cout<<l<<endl;
	else
	{
		l--;
		cout<<l+n-(l*(l-1)/2ll)<<endl;
	}
	
}
int main()
{
	IOS;
	int T=1;
	cin>>T;

	while(T--)
	{
		solve();
	}

	return 0;
}

